package cn.ecpay.unionpay.settle.web;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;
import javax.servlet.annotation.WebListener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

import cn.ecpay.unionpay.settle.util.SDKConfig;


/**
 * 
 * @ClassName AutoLoadServlet
 * @Description 
 * @date 2017-3-30 下午4:20:05
 * 声明：以下代码只是为了方便机构测试而提供的样例代码，机构可以根据自己需要，按照技术文档编写。该代码仅供参考，不提供编码，性能，规范性等方面的保障<br>
 */
@WebListener
public class AutoLoadListener implements ServletContextListener {
	//日志记录器
	Logger logger = LoggerFactory.getLogger(getClass());
	
    @Override
    public void contextDestroyed(ServletContextEvent arg0) {
    	logger.info("================= contextDestroyed");
    }
    
    @Override
    public void contextInitialized(ServletContextEvent arg0) {
    	 logger.info("================= contextInitialized");
    	 SDKConfig.getConfig().loadPropertiesFromSrc();// 从classpath加载fsas_sdk.properties文件
    }
}
